﻿using ChurchDiary.BLL;
using ChurchDiary.TableEntity;
using ChurchWebsite.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ChurchWebsite.Areas.Admin.Controllers
{
    public class OrganizationZonesController : BaseController
    {
        //
        // GET: /Admin/OrganizationZones/

        public ActionResult Index()
        {
            return View();
        }
        public JsonResult GetOrganizationZones()
        {
            BLL_Organization OP = new BLL_Organization();
            return Json(OP.GetOrganizationPartitions(),JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetOrganizationZone(Guid dataId)
        {
            BLL_Organization OP = new BLL_Organization();
            return Json(OP.GetOrganizationPartition(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateOrganizationPartion(EnitityOrganizationPartition OrganizationPartition)
        {
            BLL_Organization OP = new BLL_Organization();
            return Json(OP.UpdateOrganizationPartion(OrganizationPartition));
        }
        public JsonResult DeleteOrganizationPartion(Guid dataId)
        {
            BLL_Organization OP = new BLL_Organization();
            return Json(OP.DeleteOrganizationPartion(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult AddOrganizationZone(EnitityOrganizationPartition OrganizationPartition)
        {
            BLL_Organization OP = new BLL_Organization();
            return Json(OP.AddOrganizationPartion(OrganizationPartition));
        }
    }
}
